<template>
	<view class="preview">
		<swiper :indicator-dots="true" :autoplay="false" :interval="3000" :duration="1000" circular>
			<swiper-item v-for="(item,index) in 5">
				<image src="../../static/logo.png" mode="" @click="maskChange"></image>
			</swiper-item>

		</swiper>
		<!-- 遮罩层 -->
		<view class="mask" v-if="maskState">
			<view class="goBack">


			</view>
			<view class="count">
				3&nbsp;/&nbsp;9
			</view>
			<view class="time">
				<uni-dateformat :date="new Date()" format="hh:mm"></uni-dateformat>

			</view>
			<view class="date">
				<uni-dateformat :date="new Date()" format="MM月dd日"></uni-dateformat>
			</view>
			<view class="footer">
				<view class="box">
					<uni-icons type="info" size="28"></uni-icons>
					<view class="text" @click="clickInfo">
						信息
					</view>

				</view>
				<view class="box">
					<uni-icons type="star" size="28"></uni-icons>
					<view class="text">
						收藏
					</view>

				</view>
				<view class="box">
					<uni-icons type="download" size="28"></uni-icons>
					<view class="text">
						下载
					</view>

				</view>


			</view>
		</view>
		<!-- 弹窗 -->
		<uni-popup ref='infoPop' type="bottom">
			<view class="infoPopup">

				<view class="popHeader">
					<view class="">
						&nbsp;

					</view>
					<view class="title">壁纸信息
					</view>
					<view class="close">
						<uni-icons type='closeempty' size="18" color="#999"></uni-icons>
					</view>

				</view>
				<scroll-view scroll-y>
					<view class="content">
						<view class="row">
							<view class="label">
								壁纸ID：
							</view>
							<text selectable class="value">123114514</text>
						</view>
						<view class="row">
							<view class="label">
								发布者：
							</view>
							<text selectable class="value">咸虾米</text>
						</view>
						<view class="row ">
							<view class="label">
								评分：
							</view>
							<view class="value rotaBox ">
								<uni-rate v-model='rate' @change="onChange" readonly touchable size="16"></uni-rate>
								<view class="score">
									{{rate}}分

								</view>

							</view>
						</view>
						<view class="row">
							<view class="label">
								摘要：
							</view>
							<text selectable class="value">青年文摘</text>
						</view>
					</view>
				</scroll-view>
			</view>
		</uni-popup>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				maskState: false,
				rate: 3.5

			}
		},
		methods: {
			maskChange() {
				this.maskState = !this.maskState

			},
			// 点击Info弹窗
			clickInfo() {
				this.$refs.infoPop.open()
				console.log()


			},
			onChange(e) {
				console.log(e)

			}

		}
	}
</script>

<style lang="scss" scoped>
	.preview {
		width: 100%;
		height: 100vh;

		swiper {
			width: 100%;
			height: 100%;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.mask {
			&>view {
				position: absolute;
				left: 0;
				right: 0;
				margin: auto;
				color: #fff;
				// 有多少内容就占用多大
				width: fit-content;
			}

			.goBack {}

			.count {
				top: 10vh;
				background: rgba(0, 0, 0, .3);
				backdrop-filter: blur(10rpx);
				font-size: 28rpx;
				border-radius: 40rpx;
				padding: 8rpx 28rpx;
			}

			.time {
				font-size: 140rpx;
				top: calc(10vh + 80rpx);
				font-weight: 100;
				line-height: 1em;
				text-shadow: 0 4rpx rgba(0, 0, 0, .3);
			}

			.date {

				font-size: 34rpx;
				top: calc(10vh + 230rpx);
				text-shadow: 0 2rpx rgba(0, 0, 0, .3);
			}

			.footer {
				background: rgba(255, 255, 255, .8);
				bottom: 10vh;
				width: 65vw;
				height: 120rpx;
				border-radius: 120rpx;
				color: #000;
				display: flex;
				justify-content: space-around;
				align-items: center;
				box-shadow: 0 2rpx 0 rgba(0, 0, 0, .1);
				backdrop-filter: blur(20rpx);

				.box {
					display: flex;
					align-items: center;
					justify-content: center;
					flex-direction: column;
					// 细节增加触控
					padding: 2rpx 12rpx;
					border: 1px solid red;

					.text {
						font-size: 26rpx;
						color: #777;
					}
				}
			}
		}

		.infoPopup {
			background: #fff;
			padding: 30rpx;
			border-radius: 30rpx 30rpx 0 0;
			overflow: hidden;

			.popHeader {
				display: flex;
				justify-content: space-between;
				align-items: center;

				.title {
					color: #676767;
					font-size: 26rpx;
				}

				.close {
					border: 1px solid red;
					padding: 5rpx;
				}
			}

			scroll-view {
				max-height: 60vh;

				.content {
					.row {
						display: flex;
						padding: 16rpx 0;
						font-size: 32rpx;
						line-height: 1.7rem;

						.label {
							color: #a7a7a7;
							width: 140rpx;
							text-align: right;
							font-size: 30rpx;
						}

						.value {
							flex: 1;
							width: 0;
						}

						.rotaBox {
							display: flex;
							align-items: center;

							.score {
								font-size: 26rpx;
								color: #000;
								padding-left: 10rpx;
							}
						}


					}
				}
			}
		}
	}
</style>